﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright company="Microsoft Corp." file="TestWebResponse.cs">
//   All rights reserved. See License.txt in the project root for license information.
// </copyright>
// 
// --------------------------------------------------------------------------------------------------------------------
namespace AzureManagementTests.TestSupport
{
    using System;
    using System.IO;
    using System.Net;
    using System.Text;

    public class TestWebResponse : WebResponse
    {
        private readonly MemoryStream responseStream;

        private readonly WebHeaderCollection headers = new WebHeaderCollection();

        public TestWebResponse(string response)
        {
            this.responseStream = new MemoryStream(Encoding.UTF8.GetBytes(response));
            this.Headers.Add("x-ms-request-id", Guid.NewGuid().ToString());
        }

        public override WebHeaderCollection Headers
        {
            get
            {
                return this.headers;
            }
        }

        public override Stream GetResponseStream()
        {
            return this.responseStream;
        }
    }
}